﻿using System;

namespace _2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n1 = 10, n2 = 20;
            Swap(ref n1,ref n2);
            Console.WriteLine($"n1={n1},n2={n2}");
        }

        private static void Swap(ref int n1,ref int n2)
        {
            n1 = n1 + n2;
            n2 = n1 - n2;
            n1 = n1 - n2;
            return;
        }
    }
}
